#!/usr/bin/python
# -*- coding: utf8 -*-
import datetime

import xmpp
from plugin import Plugin

class IpsumModule(Plugin):
    infos = {'name': 'Mariage !',
            'author': 'magnetik',
            'version': '0.1',
            'website':'http://blog.magnetik.org',
            'handlers': ['mariage','benoit','sarah'],
            'cmd': 'mariage',
            }
    doc=_(u"Commande qui ne sert pas à grand chose pour pas longtemps..")
    
    def mariage(self,conn,user,command,args,mess,lang):
        difference=datetime.datetime(2007, 7, 12, 13, 0, 0) - datetime.datetime.now()
        weeks, days = divmod(difference.days, 7)
        minutes, seconds = divmod(difference.seconds, 60)
        hours, minutes = divmod(minutes, 60)
        weeks=abs(weeks)
        conn.send(xmpp.protocol.Message(mess.getFrom(),"%d semaines, %d jours, %d heures, %d minutes et %d secondes avant le mariage !\nProfite-en bien ! :-)"% (weeks, days, hours, minutes, seconds),"chat"))
        
